package its_models.student_model;

import its_models.student_model.student_model_diagnosis.StepsManagement;
import model_controller.ControlLayer;

public class StudentModel {

    public StudentModel(ControlLayer inputController){
        // 20091015 phrase2 start
        // amendment
         stepsManager = new StepsManagement(inputController);
        // 20091015 phrase2 end

         // 20100118
         misconceptionNum = 0;
       
    }

     /* steps management functions  start ***************************************************/
    public boolean isUndoEnabled(){
        return stepsManager.isUndoEnable();
    }
    public boolean isRedoEnabled(){
        return stepsManager.isRedoEnable();
    }
    public String undoSteps(){
        return stepsManager.undoSteps();
    }
    public String redoSteps(){
        return stepsManager.redoSteps();
    }
    public int getCellPosition(String inputCommand){
        return stepsManager.getCellPosition(inputCommand);
    }
    public String getActionCommand(String inputCommand){
        return stepsManager.getActionCommand(inputCommand);
    }
    public int getInvolvedValue(String inputCommand){
        return stepsManager.getInvlovedValue(inputCommand);
    }
    public void recordSteps(int inputCellIndex, int inputCellValue, String inputActionCommand){
        int cellIndex = inputCellIndex;
        int cellValue = inputCellValue;
        String actionCommand = inputActionCommand;
        /* empty stack whenever an new input from user */
        stepsManager.emptyRedoStack();
        stepsManager.addSteps(cellIndex, cellValue, actionCommand);
        /* review Steps for user */
    }

    // 20091029 phrase2 start
    public int getCorrectStepsCount(){
        return stepsManager.getCorrectStepsCount();
    }
    // 20091029 phrase2 end

    // 20100118
    public int getMisconceptionNum(){
        return misconceptionNum;
    }
    public void setMisconceptionNum(int value){
        misconceptionNum = value;
    }

    /* steps management functions  end ***************************************************/

    /* Student model diagonsis - Steps management variables */
    private StepsManagement stepsManager;

    // 20100118
    private int misconceptionNum;

    // 20091015 phrase2 start
    private ControlLayer Controller;
    // 20091015 phrase2 end

}
